﻿@model FILSTARTUPS_CMS.Models.Event

@{
    ViewBag.Title = "CreateEvent";
}

@section Pagename{
<h2>CreateEvent</h2>
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<script type="text/javascript">

    $(function () {
        var dates = $("#from, #to").datepicker({
            defaultDate: "+1w",
            changeMonth: true,
            numberOfMonths: 1,
            onSelect: function (selectedDate) {
                var option = this.id == "from" ? "minDate" : "maxDate",
					instance = $(this).data("datepicker"),
					date = $.datepicker.parseDate(
						instance.settings.dateFormat ||
						$.datepicker._defaults.dateFormat,
						selectedDate, instance.settings);
                dates.not(this).datepicker("option", option, date);
            }
        });
    });

   
	</script> 

@if (TempData["message"] != null)
{
<div class="error">@TempData["message"].ToString()</div>
}

@using (Html.BeginForm("CreateEvent", "Post", FormMethod.Post, new { id = "formSubmit", @class = "form-stacked" }))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Post</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.eventtitle)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.eventtitle)
            @Html.ValidationMessageFor(model => model.eventtitle)
        </div>

         <div class="editor-label">
            <b>Display Mode</b>
        </div>
        <div class="editor-field">
            @Html.DropDownList("routingid", new SelectList(ViewData["routingidFK"] as System.Collections.IEnumerable,
                                                "routingidPK", "routingname"))
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.eventdescription)
        </div>
        <div class="editor-field">
              @Html.TextAreaFor(model => model.eventdescription, new { @class = "ckeditor" })
         </div>


        <div class="editor-label">
            @Html.LabelFor(model => model.eventdatestart)
        </div>
        <div class="editor-field">
        <input type="text" id="from" name="from" />
@*            @Html.EditorFor(model => model.validitydate, new { @name = "validitydate" })
            @Html.ValidationMessageFor(model => model.validitydate)
*@        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.eventdateend)
        </div>
        <div class="editor-field">
        <input type="text" id="to" name="to" />
           @* @Html.EditorFor(model => model.eventdateend, new { @name = "eventdateend" })*@
        </div>
        <br />
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
